package demo1;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;

public class Test {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("demo1");
        People people = context.getBean(People.class);
        people.sayhi();
    }
}
@Component
class People{
    public void sayhi(){
        System.out.println("说你好~~！！");
    }
}